//此处封装axios网络请求，添加请求拦截器
import axios, { AxiosRequestConfig } from "axios";
//设置基础域名（请求地址）
axios.defaults.baseURL = "http://10.3.132.84:10086";
import { Toast } from "vant";
import "vant/es/toast/style";

// 请求拦截器处理，添加请求头
axios.interceptors.request.use(
  (config: AxiosRequestConfig): AxiosRequestConfig => {
    config.headers && (config.headers.authorization = `Bearer ${localStorage.getItem("token")}`)

    return config;
  }
);
export default axios;
